package org.shiro.model;

import java.util.HashSet;
import java.util.Set;

public class User {
	/**
	 * 用户id
	 */
	private Integer uid;

	/**
	 * 用户名
	 */
	private String username;

	/**
	 * 密码
	 */
	private String password;

	private Set<Role> roles = new HashSet<Role>();

	public Set<Role> getRoles() {
		return roles;
	}

	public void setRoles(Set<Role> roles) {
		this.roles = roles;
	}

	/**
	 * 用户id
	 * 
	 * @return uid 用户id
	 */
	public Integer getUid() {
		return uid;
	}

	/**
	 * 用户id
	 * 
	 * @param uid 用户id
	 */
	public void setUid(Integer uid) {
		this.uid = uid;
	}

	/**
	 * 用户名
	 * 
	 * @return username 用户名
	 */
	public String getUsername() {
		return username;
	}

	/**
	 * 用户名
	 * 
	 * @param username 用户名
	 */
	public void setUsername(String username) {
		this.username = username == null ? null : username.trim();
	}

	/**
	 * 密码
	 * 
	 * @return password 密码
	 */
	public String getPassword() {
		return password;
	}

	/**
	 * 密码
	 * 
	 * @param password 密码
	 */
	public void setPassword(String password) {
		this.password = password == null ? null : password.trim();
	}
}